﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

namespace ParticlesEngine
{
    class ParticleEmitter {
        Vector3 p1,p2;
        int width, height;
        Random randomNumbersCreator;

        //defines an square area where particles are created inside, randomly.
        public ParticleEmitter(Vector3 position, int width, int height){
            this.width = width;
            this.height = height;
            p1.X = position.X - width * 0.5f;
            p1.Z = position.Z - height * 0.5f;
            p2.X = position.X + width * 0.5f;
            p2.Z = position.Z + height * 0.5f;
            randomNumbersCreator = new Random();
        }
        public Vector3 getPosition() {
            Vector3 randomPoint = p1;
            randomPoint.X = randomNumbersCreator.Next(width);
            randomPoint.Z = randomNumbersCreator.Next(height);

            return p1 + randomPoint;
        }
    }
}
